Integrand size = 37, antiderivative size = 191 \[ \int \cos (c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {b^2 (C (1-n)-A n) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2-n}{2},\frac {4-n}{2},\cos ^2(c+d x)\right ) (b \sec (c+d x))^{-2+n} \sin (c+d x)}{d (2-n) n \sqrt {\sin ^2(c+d x)}}-\frac {b B \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-n}{2},\frac {3-n}{2},\cos ^2(c+d x)\right ) (b \sec (c+d x))^{-1+n} \sin (c+d x)}{d (1-n) \sqrt {\sin ^2(c+d x)}}+\frac {b C (b \sec (c+d x))^{-1+n} \tan (c+d x)}{d n} \]
[Out]
Time = 0.23 (sec) , antiderivative size = 191, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.135, Rules used = {16, 4132, 3857, 2722, 4131} \[ \int \cos (c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {b^2 (C (1-n)-A n) \sin (c+d x) (b \sec (c+d x))^{n-2} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2-n}{2},\frac {4-n}{2},\cos ^2(c+d x)\right )}{d (2-n) n \sqrt {\sin ^2(c+d x)}}-\frac {b B \sin (c+d x) (b \sec (c+d x))^{n-1} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-n}{2},\frac {3-n}{2},\cos ^2(c+d x)\right )}{d (1-n) \sqrt {\sin ^2(c+d x)}}+\frac {b C \tan (c+d x) (b \sec (c+d x))^{n-1}}{d n} \]
[In]
[Out]
Rule 16
Rule 2722
Rule 3857
Rule 4131
Rule 4132
Rubi steps \begin{align*} \text {integral}& = b \int (b \sec (c+d x))^{-1+n} \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx \\ & = b \int (b \sec (c+d x))^{-1+n} \left (A+C \sec ^2(c+d x)\right ) \, dx+B \int (b \sec (c+d x))^n \, dx \\ & = \frac {b C (b \sec (c+d x))^{-1+n} \tan (c+d x)}{d n}+\frac {(b (C (-1+n)+A n)) \int (b \sec (c+d x))^{-1+n} \, dx}{n}+\left (B \left (\frac {\cos (c+d x)}{b}\right )^n (b \sec (c+d x))^n\right ) \int \left (\frac {\cos (c+d x)}{b}\right )^{-n} \, dx \\ & = -\frac {B \cos (c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-n}{2},\frac {3-n}{2},\cos ^2(c+d x)\right ) (b \sec (c+d x))^n \sin (c+d x)}{d (1-n) \sqrt {\sin ^2(c+d x)}}+\frac {b C (b \sec (c+d x))^{-1+n} \tan (c+d x)}{d n}+\frac {\left (b (C (-1+n)+A n) \left (\frac {\cos (c+d x)}{b}\right )^n (b \sec (c+d x))^n\right ) \int \left (\frac {\cos (c+d x)}{b}\right )^{1-n} \, dx}{n} \\ & = -\frac {B \cos (c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-n}{2},\frac {3-n}{2},\cos ^2(c+d x)\right ) (b \sec (c+d x))^n \sin (c+d x)}{d (1-n) \sqrt {\sin ^2(c+d x)}}+\frac {(C (1-n)-A n) \cos ^2(c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2-n}{2},\frac {4-n}{2},\cos ^2(c+d x)\right ) (b \sec (c+d x))^n \sin (c+d x)}{d (2-n) n \sqrt {\sin ^2(c+d x)}}+\frac {b C (b \sec (c+d x))^{-1+n} \tan (c+d x)}{d n} \\ \end{align*}
Time = 0.52 (sec) , antiderivative size = 161, normalized size of antiderivative = 0.84 \[ \int \cos (c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {\left (A n (1+n) \cos (c+d x) \cot (c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-1+n),\frac {1+n}{2},\sec ^2(c+d x)\right )+(-1+n) \csc (c+d x) \left (B (1+n) \cos (c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n}{2},\frac {2+n}{2},\sec ^2(c+d x)\right )+C n \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1+n}{2},\frac {3+n}{2},\sec ^2(c+d x)\right )\right )\right ) (b \sec (c+d x))^n \sqrt {-\tan ^2(c+d x)}}{d (-1+n) n (1+n)} \]
[In]
[Out]
\[\int \cos \left (d x +c \right ) \left (b \sec \left (d x +c \right )\right )^{n} \left (A +B \sec \left (d x +c \right )+C \sec \left (d x +c \right )^{2}\right )d x\]
[In]
[Out]
\[ \int \cos (c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} \left (b \sec \left (d x + c\right )\right )^{n} \cos \left (d x + c\right ) \,d x } \]
[In]
[Out]
\[ \int \cos (c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int \left (b \sec {\left (c + d x \right )}\right )^{n} \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \cos {\left (c + d x \right )}\, dx \]
[In]
[Out]
\[ \int \cos (c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} \left (b \sec \left (d x + c\right )\right )^{n} \cos \left (d x + c\right ) \,d x } \]
[In]
[Out]
\[ \int \cos (c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} \left (b \sec \left (d x + c\right )\right )^{n} \cos \left (d x + c\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos (c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int \cos \left (c+d\,x\right )\,{\left (\frac {b}{\cos \left (c+d\,x\right )}\right )}^n\,\left (A+\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right ) \,d x \]
[In]
[Out]